<?php
header("content-type:text/html; charset = utf-8");
$host = "127.0.0.1";
$username = "root";
$passwd= "root";
$link = @mysql_connect($host,$username,$passwd) or die("失败");
//mysql_query("set_ names_utf8");
$sql ="show databases";
$res = mysql_query($sql);
while ($a = mysql_fetch_row($res)){
   var_dump($a);
echo"<a style = 'padding:10px' href = 'mysql.php?'database=$a[0]>".$a[0]."</a>";
}

if(!empty($_GET['database'])){
    $datab = $_GET['database'];
    mysql_select_db("$datab",$link);
    $sql1 = "show tables";
    $k = mysql_query($sql1,$link);
    while ($b =mysql_fetch_array($k)){
        var_dump($b);
    }
}
$sq12="desc user";
?>